home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1993 September / September 93.iso / Archives / Mac FAQ / Mac Programmer.FAQ < prev    next >
Internet Message Format  |  1993-08-31  |  70KB

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!pad-thai.aktis.com!pad-thai.aktis.com!not-for-mail
  2. From: Daryl_Spitzer@mindlink.bc.ca (Daryl Spitzer)
  3. Newsgroups: comp.sys.mac.programmer,news.answers
  4. Subject: Comp.Sys.Mac.Programmer FAQ Part 1/2 (1/12/93)
  5. Supersedes: <macintosh/programmer-faq/part1_745560008@GZA.COM>
  6. Followup-To: poster
  7. Date: 24 Aug 1993 00:00:12 -0400
  8. Organization: none
  9. Lines: 1297
  10. Sender: faqserv@GZA.COM
  11. Approved: news-answers-request@MIT.Edu
  12. Distribution: world
  13. Expires: 14 Sep 1993 04:00:09 GMT
  14. Message-ID: <macintosh/programmer-faq/part1_746164809@GZA.COM>
  15. Reply-To: Daryl_Spitzer@mindlink.bc.ca
  16. NNTP-Posting-Host: pad-thai.aktis.com
  17. Summary: Frequently Asked Questions list for comp.sys.mac.programmer
  18. Keywords: frequently asked questions faq
  19. X-Last-Updated: 1993/01/20
  20. Xref: senator-bedfellow.mit.edu comp.sys.mac.programmer:67479 news.answers:11722
  21.  
  22. Archive-name: macintosh/programmer-faq/part1
  23. Last-modified: 1993/01/12
  24.  
  25.  
  26.                      +---------------------------------+
  27.                      | Frequently Asked Questions List |
  28.                      |   for Comp.Sys.Mac.Programmer   |
  29.                      |         January 12, 1993        |
  30.                      |            PART  ONE            |
  31.                      +---------------------------------+
  32.  
  33.  
  34. This FAQ list is automatically posted once a week to comp.sys.mac.programmer.
  35. It is also available via anonymous ftp from ftp.cs.uoregon.edu [128.223.8.8]
  36. (user name 'anonymous', your internet address as password) in the files
  37. /pub/mac/csmp-faq-1 and /pub/mac/csmp-faq-2.
  38.  
  39. This FAQ list is maintained by Daryl Spitzer.  He can be reached at the
  40. following addresses:
  41.  
  42.    Internet:  Daryl_Spitzer@mindlink.bc.ca
  43.    SnailMail: 203 - 1385 West 12th Avenue
  44.               Vancouver, BC  (Canada)
  45.               V6H 1M2
  46.  
  47. The purpose of the FAQ list is to answer some of the most common questions
  48. asked on this group, and to refer people left with unanswered questions to
  49. available sources of additional help.  You should read the FAQ list before
  50. posting to comp.sys.mac.programmer.
  51.  
  52. Submissions, comments, etcetera, should be sent to Daryl Spitzer, as above.
  53. All such material sent will be considered to have entered the public domain
  54. (and will be subject to editing) unless specific text to the contrary
  55. accompanies the message (which may render the submission unusable).
  56.  
  57.  
  58.  
  59.                          Changes since August 3, 1992
  60.                          ----------------------------
  61.  
  62.  - the keeper of the FAQ is now Daryl Spitzer (Daryl_Spitzer@mindlink.bc.ca)
  63.  
  64.  - 1.2  Debuggers:
  65.     added Fritz Anderson's description of SourceBug
  66.  
  67.  - 2.1  The Associates and Partners Programs:
  68.     new description, DEVHOTLINE is no longer a valid AppleLink address
  69.  
  70.  - 2.3  APDA
  71.     new address and telephone numbers
  72.  
  73.  - 3.1.1  Technical Books
  74.     new Inside Macintosh volumes
  75.  
  76.  - 3.1.3  Periodicals:
  77.     MacTutor is now MacTech
  78.  
  79.  
  80.  
  81.  
  82.                              Table of Contents
  83.                               -----------------
  84.  
  85. Part One  (this file)
  86. ---------------------
  87.  
  88.   I.    Development Software
  89.           1. Compilers
  90.           2. Debuggers
  91.           3. Other Tools
  92.  
  93.   II.   Apple Developer Programs
  94.           1. The Associates and Partners Programs
  95.           2. Apple Developer University
  96.           3. APDA
  97.           4. Developer CDs
  98.  
  99.   III.  Sources of Information
  100.           1. Books and Periodicals
  101.                1. Technical Books
  102.                2. Teaching Books
  103.                3. Periodicals
  104.           2. Mailing Lists
  105.                1. Comp.Sys.Mac.Programmer Digest
  106.                2. Think Class Library Discussion
  107.                3. MacPsych
  108.           3. Miscellaneous
  109.                1. Usenet Mac Programmer's Guide (UMPG)
  110.                2. Kent Sandvik's Frequently Asked MPW C++ and MacApp
  111. Questions
  112.                3. Comp.Sys.Mac.FAQ
  113.  
  114.   IV.   Archive Sites
  115.           1. ftp.apple.com [130.43.2.3]
  116.           2. sumex-aim.stanford.edu [36.44.0.6]
  117.           3. rascal.ics.utexas.edu [128.83.138.20]
  118.           4. mac.archive.umich.edu [141.211.164.153]
  119.           5. ftp.cs.uoregon.edu [128.223.8.8]
  120.           6. ics.uci.edu [128.195.1.1]
  121.           7. ftp.brown.edu [128.148.176.55]
  122.           8. comp.binaries.mac [newsgroup]
  123.  
  124.   V.    One-liners
  125.           1. The Main Loop and Events
  126.           2. Menus
  127.           3. Resources
  128.           4. Windows, Alerts, and Dialogs
  129.           5. Drawing
  130.           6. Files
  131.           7. Interrupts and VBL Tasks
  132.           8. Handles and Pointers
  133.           9. General
  134.  
  135.  
  136. Part Two  (separate file)
  137. -------------------------
  138.  
  139.   VI.   Specific Questions Answered
  140.           1. The Main Loop and Events
  141.                1. How do you tell if a specific key is being pressed?
  142.                2. How can I get millisecond timing from the keyboard
  143.                   (or mouse)?
  144.           2. Menus
  145.                1. When do you put an ellipsis on the end of a menu item?
  146.                2. How do I get the menubar to disappear and re-appear?
  147.                3. What's the difference between the resource ID of a 'MENU'
  148.                   resource and the menuID field of that resource?
  149.           3. Windows, Alerts, and Dialogs
  150.                1. How do you put a border around the default button in a
  151.                   dialog?
  152.           4. Drawing
  153.                1. What is the fastest way to paint one pixel on the screen?
  154.                2. How do you draw directly into a pixmap without using
  155.                   QuickDraw?
  156.                3. How do you draw directly onto the screen without using
  157.                   QuickDraw?
  158.                4. What RGB value does the system use for dimmed buttons,
  159.                   menus and window titles?
  160.           5. Files
  161.                1. Why is the File Manager so hard to use?
  162.                2. How do you get a full pathname?
  163.                3. How do you set the SFGet/PutFile directory?
  164.                4. How do you access the application's data fork?
  165.           6. Handles and Pointers
  166.                1. When should I call MoveHHi?
  167.                2. Why does malloc/calloc keep crashing or returning NULL in
  168.                   Think C?
  169.           7. Standalone Code
  170.                1. How do I write an INIT?
  171.           8. General
  172.                1. How do I register signatures and file types with Apple?
  173.                2. How do I go about writing serial port communications?
  174.  
  175.  
  176.   VII.  Eternal Debates:
  177.           1. Why doesn't the Mac do preemptive multitasking?
  178.  
  179.  
  180.  
  181. =============================================================================
  182.  
  183.  
  184.                      ===================================
  185.                        Section I: Development Software
  186.                      ===================================
  187.  
  188.  
  189. This is by no means a complete analysis of the tools, development systems,
  190. etc. that are available.  This is a short list of things which *most* Mac
  191. programmers use (or are at least aware of, and have considered using).
  192.  
  193.  
  194.  
  195. 1.1  Compilers
  196. --------------
  197.  
  198. Macintosh Programmer's Workshop (Apple)
  199. ---------------------------------------
  200.  
  201. MPW is a package which contains separately-purchaseable compilers for
  202. Assembly, C, C++, and Object Pascal.  All of these run in an environment
  203. called the MPW Shell.  The Shell is a command-line oriented environment,
  204. designed for extreme configurability with scripts, user-writeable "tools",
  205. i/o redirection, and lots of other bells and whistles.  On the pro side, it
  206. can do many things that THINK cannot do; it scales much better to large
  207. projects; it can be customized much more; and it's Apple's supported
  208. development environment.  On the con side, it is comparatively expensive,
  209. slow, and difficult to learn.  A debugger (SADE) is available for it, and
  210. is philosophically similar to MPW.  An object library is available (MacApp)
  211. which allows applications to be built on an object-oriented framework, again
  212. similar to MPW in it's approach of being very powerful, but not necessarily
  213. easy to learn, easy to use, small, or fast.
  214.  
  215. MPW is also available on the quarterly Essentials-Tools-Objects CD-ROM from
  216. Apple.  This disc contains the latest version of the entire MPW development
  217. environment, as well as debugging utilities and a huge collection of sample
  218. source code.  This brings the price of the MPW environment down a bit, but
  219. it's still much more expensive than THINK.
  220.  
  221.  
  222. Think (Symantec)
  223. ----------------
  224.  
  225. Think is two separate products, Think C and Think Object Pascal.  They are
  226. similar products.  Both are integrated editor/compiler/linker/debugger
  227. environments.  Both come with a large library of predefined classes (the C
  228. classes are written in a sort of pseudo C++ language that is Symantec's own
  229. Object C, not C++).  Think Pascal is MacApp-compatable, as well.  Both
  230. support inline assembly, but there is no separate assembler.  Their main
  231. selling point, however, is that they are very fast and very simple.  They are
  232. ideal for small projects that you want to finish in a few days, for
  233. beginners, and for people who need a full-fledged development environment but
  234. cannot afford MPW.  This is not to say that the Think environments are not
  235. useful for commercial development; many successful commercial programs were
  236. written with Think.  The difference in power between MPW and Think is only
  237. noticeable with very large and/or multiple-developer projects.
  238.  
  239.  
  240.  
  241. 1.2  Debuggers (beyond SADE and the Think debuggers)
  242. ----------------------------------------------------
  243.  
  244. MacsBug (Apple)
  245. ---------------
  246.  
  247. MacsBug is an assembly-level debugger.  It is a command-line driven, entirely
  248. text-based environment which uses little of the Mac toolbox, and is thus
  249. fairly stable in crashes (although it doesn't use protected memory, its main
  250. failing in the area of stability).  It supports complex operations with
  251. breakpoints, A-line traps, macros, expressions, and more, and can be
  252. configured even more with user-writeable 'dcmd' external code resources.
  253. MacsBug is free via anonymous ftp from ftp.apple.com.  It is also included
  254. with the book "Debugging Macintosh Software with MacsBug."
  255.  
  256.  
  257. TMON Professional (ICOM)
  258. ------------------------
  259.  
  260. TMON Professional is an object-level debugger which is MUCH more powerful
  261. than MacsBug.  It has an elaborate interface which looks nothing like a Mac
  262. application, and takes a while to get used to.  It is a very intelligent
  263. program, however, which can often display memory in its most useful format
  264. without help (e.g. it will disassemble code, and display a string as a
  265. string, automatically).  It has strong support for types, allowing you to
  266. easily view complex structures, arrays, floating point numbers, and more.
  267. You can examine the stack, the heaps, and just about anything else you could
  268. be interested in.  It also provides versatile scripting, and is amazingly
  269. configurable.  There are more goodies in this package than I can possible
  270. describe here.  Drawbacks are high price, and a very steep learning curve.
  271.  
  272.  
  273. The Debugger (Jasik Designs)
  274. ----------------------------
  275.  
  276. The Debugger (also known as Jasik's Debugger, because it was written by Steve
  277. Jasik) is the only source level debugger with all the low-level features of
  278. Macsbug (speed, straight-forward display of important info) and many of the
  279. advantages of source level debuggers (source code, quick display of local
  280. variables).  Some of its best features are complete support for Object
  281. Pascal, speed, and the ability to look at resource map and file information.
  282. You gotta love any debugger that will display all of the low-level globals
  283. with their values in a single keystroke!  It also has a On the down side,
  284. the interface is an aquired taste, the documentation needs work and
  285. distribution disks lack a certain polish.  But, phone support is very good
  286. (you often get Steve himself).
  287.  
  288.  
  289. SourceBug (Apple)
  290. -----------------
  291.  
  292. SourceBug is provided by Apple on its ETO development-tools CD.  Like SADE,
  293. SourceBug is a source-level debugger.  SADE is a scriptable,
  294. stream-in/stream-out environment like MPW: The code being debugged is
  295. displayed in text windows, with the current line highlighted.  Data
  296. structures
  297. can be inspected, but only through printing commands; the formatting is
  298. automatic and type-sensitive.  And, you can use scripts to walk linked or
  299. array data structures automatically, and save the results to text files.
  300.  
  301. SourceBug, by contrast, is driven by mouse selections and menu commands.  The
  302. program is centered around a browser window that organizes your code by
  303. source
  304. file (or by type, if you are using C++ or Object Pascal) and module name.
  305. You
  306. set breakpoints by clicking next to the line you want to break at.  SADE
  307. requires a command to set breakpoints (though a menu item front-ends a script
  308. to set simple ones by selection); on the other hand, a SADE breakpoint can
  309. execute any script, permitting snapshots and conditional breaks.  SourceBug
  310. gives you only an unconditional break.
  311.  
  312. The same dichotomy applies to data structures:  SourceBug is nearly as smart
  313. as SADE in parsing data, and provides you with an inspector for most
  314. instances
  315. of C++ or Pascal objects.  But finding data, link traversals, and some
  316. formatting are strictly manual jobs.  Variable-length arrays of complex
  317. types?
  318. Forget it.  SADE can handle them, SourceBug can't.
  319.  
  320. For most purposes, SourceBug is the better debugger.  It is rare that you
  321. need
  322. SADE's strengths badly enough to compose the suite of breakpoints and testing
  323. scripts you will need to make SADE effective.  SourceBug is better at 99% of
  324. the debugging tasks:  For instance, when you break into SourceBug, the
  325. currently-executing procedure is displayed in a window, with an arrow
  326. pointing
  327. to the current line.  In the upper part of the window is the stack crawl;
  328. click on any item in the list to see any procedure in the calling chain, see
  329. the line that made the call, and inspect (the optimizer permitting) the local
  330. variables of any procedure in the chain.  To do the same in SADE requires
  331. issuing a command to dump the stack and selecting a code address identifier
  332. in
  333. the result.  To examine a variable in use by a caller, you will have to use
  334. SADE's scoping language to provide it with enough context to identify the
  335. address.  SADE can do more, but it can't carry enough context to be as
  336. helpful
  337. as SourceBug.
  338.  
  339.  
  340.  
  341. 1.3  Other Tools
  342. ----------------
  343.  
  344. ResEdit (Apple)
  345. ---------------
  346.  
  347. ResEdit is the accepted tool for editing and creating resources.  It has very
  348. little competition, partially because it is a very good and comprehensive
  349. program, and partially because it is free (available via anonymous ftp from
  350. ftp.apple.com).  It allows you to edit any resource in hexadecimal, and most
  351. of the standard types have special editors that provide a direct-manipulation
  352. paradigm for editing them.  Users may write their own pickers and editors for
  353. custom resource types, although this is rarely done in practice.
  354.  
  355.  
  356. Resorcerer (Mathemaesthetics)
  357. ------------------------------
  358.  
  359. Resorcerer is a commercially available replacement for ResEdit.  Many
  360. developers use it exclusively, and swear by it quite vehemently.  This is
  361. from one of them:
  362.  
  363.       RESORCERER is a no-holds-barred resource dynamo.
  364.         -- embarrasses the ResEdit dialog editor
  365.         -- supports many more template data types
  366.         -- swap in different resource templates based on a key value
  367.         -- creates recursive resources
  368.         -- generates starter code for a dialog
  369.         -- does complex searches against resource contents or titles
  370.         -- renumbers resources in batches
  371.         -- changes resource types
  372.         -- excellent support from the author himself
  373.  
  374. I personally like Resorcerer for some things and ResEdit for others.  There
  375. are certain resource types that cannot be edited with Resorcerer, like
  376. color icons, and others that cannot be edited with ResEdit, like help
  377. balloons.  I expect, however, that with the addition of such resource
  378. editors to Resorcerer, I will begin to use it exclusively.
  379.  
  380. The price is the major consideration for most people.  ResEdit is free from
  381. Apple, while Resorcerer is a commercial product (available for around $250).
  382.  
  383.  
  384. Virtual User (Apple)
  385. --------------------
  386.  
  387. Virtual User allows you to script user interactions with a program so that
  388. they cal be relayed over and over, and it can execute scripts remotely, over
  389. AppleTalk.  So, for instance, you could write a script that puts your program
  390. through its paces, and then automatically execute that script simultaneously
  391. on lots of differently configured Macintosh systems.  It is available from
  392. APDA (#M0987LL/B).  [This paragraph taken from develop Issue 8, page 60.]
  393.  
  394.  
  395. Online Companion (Addison-Wesley)
  396. ---------------------------------
  397.  
  398. Online Companion is a reference tool.  Hit a magic key combination, and a
  399. pseudo-window opens at the bottom of the screen which allows you to type in
  400. a full or partial name and find it in Online's database.  It contains Inside
  401. Mac and some supplements, Tech Notes, etc.  It's fast and simple.
  402.  
  403.  
  404. Think Reference (Symantec)
  405. --------------------------
  406.  
  407. Think Reference is a reference tool.  It is a hypertext version of Inside Mac
  408. I-V and the Tech Notes.  Click on the function or data type name to go to the
  409. page on which it is defined.  It includes some very useful notes and examples
  410. written by Symantec, and the function prototypes can be copied and pasted
  411. into your editor.  Very fast and simple to use.  But beware of typos and, in
  412. some cases, bad advice.
  413.  
  414.  
  415.  
  416.  
  417.  
  418.                    ========================================
  419.                      Section II: Apple Developer Programs
  420.                    ========================================
  421.  
  422.  
  423. 2.1  The Associates and Partners Programs
  424. -----------------------------------------
  425.  
  426. From the Macintosh Development Tools and Languages Guidebook
  427. (1993 Edition, page 15):
  428.  
  429. The Apple Associates Program is Apple's mainstream program for qualified
  430. commercial developers whose plans are well-aligned to Apple's long-term
  431. strategy.  Members of this program receive essential technical and
  432. marketing information, as well as self-help technical support tools.
  433. Eligible Apple Associates can also purchase, at special prices, a limited
  434. number of Apple systems for development purposes.
  435.  
  436. The Apple Partners Program is a development support program for
  437. Apple-selected commercial developers.  Apple Partners haves access to
  438. programs and services such as techical and marketing information, as well
  439. as direct technical support via electronic mail.  Apple Partners can also
  440. purchase, at special prices, a limited number of Apple computer systems
  441. for development purposes.
  442.  
  443. Apple Associates and Apple Partners receive a monthly mailing containing
  444. all of the information in the Technical Information Mailing.  [see section
  445. 2.4]  Two other particularly interesting products that are included are
  446. the Developer CD, which contains hundreds of megabytes of
  447. programming-related material, and Apple Direct, a newspaper that keeps
  448. developers abreast of Apple's technical developments and marketing
  449. directions.
  450.  
  451. Apple Associates and Apple Partners also get product-level support on
  452. development tools and system software, and information on how to use
  453. Apple's resources most efficiently.  Additionally, code-level support
  454. from Developer Technical Support is available to Apple Partners via
  455. electronic mail.
  456.  
  457. For more information on support programs for commercial developers
  458. contact the Developer Hotline at:
  459.  
  460. Developer Support
  461. Apple Computer Inc.
  462. 20525 Mariani Avenue, M/S 75-2C
  463. Cupertino, CA 95014
  464. (408) 974-4897
  465.  
  466. [no AppleLink address is given, but try DEVSUPPORT]
  467.  
  468.  
  469. 2.2  Apple Developer University
  470. -------------------------------
  471.  
  472. From the back cover of 'develop' Issue 7:
  473.  
  474. Apple Developer University provides training for all levels of Macintosh
  475. programmers.  The hands-on classes give you experience using the most up-
  476. to-date development tools.  Classes are offered in locations across the
  477. United States, and on-site instruction can also be arranged.  Multimedia
  478. self-paced courses are available from Developer University through APDA.
  479. These courses include Macintosh Programming Fundamentals, User-Centered
  480. Design, and Introduction to Object-Oriented Programming.
  481.  
  482. The registrar at (408) 974-6215 can reserve your place or send a current
  483. catalog.  You can also AppleLink DEVUNIV (devuniv@applelink.apple.com) or
  484. write
  485.  
  486.      20525 Mariani Avenue
  487.      M/S 75-6U
  488.      Cupertino, CA  95014
  489.  
  490.  
  491. 2.3  APDA
  492. ---------
  493.  
  494. From the Macintosh Development Tools and Languages Guidebook
  495. (1993 Edition, page 13):
  496.  
  497. APDA is an Apple service organization that offers convenient worldwide
  498. access to over 300 development tools, resources, training products, and
  499. information for anyone interested in developing applications on Apple
  500. platforms.  Customers receive the quarterly APDA Tools Catalog featuring
  501. alll of the most popular and most current versions of Apple tools and the
  502. most popular third-party development tools.  Ordering is easy, there are
  503. no membership fees and no special agreements are required for most products.
  504. APDA offers convenient payment and shipping options, including site
  505. licensing.
  506.  
  507. To order product or receive a complimentary APDA Tools Catalog, contact:
  508.  
  509.     APDA
  510.     Apple Computer Inc.
  511.     P.O. Box 319
  512.     Buffalo, New York 14207-0319 U.S.
  513.  
  514.     (800) 282-2732 U.S.
  515.     (800) 637-0029 Canada
  516.     (716) 871-6555 International
  517.     (716) 871-6511 Fax
  518.     APDA           AppleLink (apda@applelink.apple.com)
  519.     76666,2405     CompuServe
  520.     APDA           America Online
  521.  
  522.  
  523. 2.4  Developer CDs
  524. ------------------
  525.  
  526. The developer CDs are available quarterly from APDA, or monthly to Apple
  527. Associates and Partners.  The quarterly version is also included in the
  528. quarterly issue of d e v e l o p.  They contain just about everything that
  529. Apple makes freely available, including SpInside Mac, the Tech Notes, and
  530. a plethora of code snippets.
  531.  
  532.  
  533.  
  534.  
  535.  
  536.                    =======================================
  537.                      Section III: Sources of Information
  538.                    =======================================
  539.  
  540.  
  541. 3.1  Books and Periodicals
  542. --------------------------
  543.  
  544. 3.1.1  Technical Books
  545. ----------------------
  546.  
  547.  
  548. Inside Macintosh Volume I
  549.    Addison-Wesley.  ISBN 0-201-17731-5.  $24.95
  550. Inside Macintosh Volume II
  551.    Addison-Wesley.  ISBN 0-201-17732-3.  $24.95
  552. Inside Macintosh Volume III
  553.    Addison-Wesley.  ISBN 0-201-17733-1.  $19.95
  554. Inside Macintosh Volume IV
  555.    Addison-Wesley.  ISBN 0-201-05409-4.  $24.95
  556. Inside Macintosh Volume V
  557.    Addison-Wesley.  ISBN 0-201-17719-6.  $26.95
  558. Inside Macintosh Volume VI
  559.    Addison-Wesley.  ISBN 0-201-57755-0.  $39.95
  560.  
  561.      Inside Mac is the definitive reference regarding the Macintosh toolbox.
  562.      Volumes I and II are basically essential to any Mac programmer who uses
  563.      the toolbox at all.  Volume III is essentially a summary, cross
  564.      reference, index-y sort of thing, and isn't very useful.  Volume IV is
  565.      stuff specific to the Mac Plus and later machines, which would make it
  566.      almost as important as I and II (not many 512K Macs left out there),
  567.      except that the routines it describes are not nearly as generally
  568.      useful.  It does have all of the stuff on the HFS File Manager, however,
  569.      so if you're working with File Manager routines you should definitely
  570.      consult IV before I-III.  Otherwise, you can survive without it for a
  571.      while.  Volume V is the Mac II volume.  It has every thing on Color
  572.      QuickDraw, as well as lots of other goodies.  I'd say it's more useful
  573.      than IV, but only if you're doing color.  Volume VI is the System 7
  574.      volume.  It contains all kinds of bizarre new things which are probably
  575.      not of general use or interest; but it contains a lot of new
  576.      non-System-7 stuff as well (such as 32-bit Quickdraw), and it has
  577.      corrections to the other five volumes.
  578.  
  579.  
  580. Inside Macintosh X-Ref, Revised Edition
  581.    Addison Wesley.  ISBN 0-201-57769-0.  $12.95.
  582.  
  583.      Inside Mac X-Ref is a cross-referenced index to the six volumes and
  584.      some other Macintosh technical books.
  585.  
  586.  
  587. Inside Macintosh: Files      ISBN 0-201-63244-6     $29.95
  588. Inside Macintosh: Memory     ISBN 0-201-63240-3     $24.95
  589. Inside Macintosh: Processes  ISBN 0-201-63241-1     $22.95
  590.  
  591.      Inside Macintosh, having previously been three authoritative
  592.      volumes, with three chronological supplements, has been due for
  593.      a rewrite and overhaul for a few years.  Apple is now in the
  594.      process of reissuing IM in 15 subject-related books, of which
  595.      only the first three have come out at this writing.
  596.  
  597.      If you have volumes I-VI, then you will eventually have to buy
  598.      the new Inside Macintosh, too.  Newcomers are in a dilemma:
  599.      The new IM has better information than the old one, but not
  600.      enough of the new IM has come out to be useful.  They will have
  601.      to judge how urgent their need is for authoritative
  602.      information.  Dabblers and beginners can probably get by with
  603.      the teaching books recommended below.  Serious work begins with
  604.      Volume I (basic ToolBox), Volume II (basic OS), and Volume IV
  605.      (for the file system).  If you need color, get Volume V; if you
  606.      do anything with processes (IPC, backgrounding), get Volume VI.
  607.  
  608.  
  609. M68000 User's Manual
  610.    Prentice Hall.  ISBN 0-13-609249-7.  $22.95.
  611. MC68020 User's Manual
  612.    Prentice Hall.  ISBN 0-13-567017-9.  $22.95.
  613. MC68030 User's Manual
  614.    Prentice Hall.  ISBN 0-13-566423-3.  $22.95.
  615. MC68881/MC68882 Floating-Point Coprocessor User's Manual
  616.    Prentice Hall.  ISBN 0-13-566936-7.  $22.95.
  617.  
  618.      The Motorola references are required reading for anyone doing assembly
  619.      programming on the Mac.  The 68000 is by far the most important.  The
  620.      68881 manual only has relevance to those who want to do floating point
  621.      and don't want to use SANE (the Standard Apple Numeric Environment,
  622.      slow but robust, precise and general).
  623.  
  624.  
  625. Technical Introduction to the Macintosh Family
  626.    Addison-Wesley.  ISBN 0-201-17765-X.  $19.95.
  627.  
  628.      This book provides an overview of the general hardware design, system
  629.      archiecture, and ROM design of the Macintosh.  It is not required for
  630.      programming, but does provide some useful background information for
  631.      programmers new to the Mac.
  632.  
  633.  
  634. Programmer's Introduction to the Macintosh Family.
  635.    Addison-Wesley.  ISBN 0-201-19254-3.  $22.95.
  636.  
  637.      This book provides an overview of basic Macintosh programming concepts.
  638.      It is recommended for programmers new to the Mac.
  639.  
  640.  
  641. Guide to the Macintosh Family Hardware
  642.    Addison-Wesley.  ISBN 0-201-52405-8.  $26.95.
  643.  
  644.      This is the definitive guide to the hardware design of the Macintosh
  645.      family.
  646.  
  647.  
  648. Designing Cards and Drivers for the Macintosh Family
  649.    Addison-Wesley.  ISBN 0-201-52404-X.  $26.95.
  650.  
  651.      This is the official guide for developers of expansion cards and
  652.      peripheral devices for the Mac.  This book is required reading for
  653.      anyone who wants to talk directly to expansion cards (video cards,
  654.      for example).
  655.  
  656.  
  657. Human Interface Guidelines: The Apple Desktop Interface
  658.    Addison-Wesley.  ISBN 0-201-17753-6.  $14.95.
  659.  
  660.      This is the definitive guide to program interface design on the
  661.      Macintosh.  When you find yourself wondering where to put the OK
  662.      button in a dialog, consult this book.
  663.  
  664.  
  665. Apple Numerics Manual
  666.    Addison-Wesley.  ISBN 0-201-17738-2.  $29.95.
  667.  
  668.      This book describes the Standard Apple Numerics Environment (SANE),
  669.      and provides information about the IEEE-standard arithmetic and
  670.      about the SANE engines on the Apple IIgs and Macintosh computers.
  671.  
  672.  
  673. Inside the Macintosh Communications Toolbox
  674.    Addison-Wesley.  ISBN 0-201-57775-5.  $24.95.
  675.  
  676.      This is the definitive reference volume for the Communications Toolbox.
  677.  
  678.  
  679.  
  680. 3.1.2  Teaching Books
  681. ---------------------
  682.  
  683.  
  684. Macintosh Programming Primer (Second Edition)
  685.    Addison-Wesley.  ISBN 0-201-60838-3.  $26.95.
  686. Macintosh C Programming Primer Volume II
  687.    Addison-Wesley.  ISBN 0-201-57016-5.  $24.95.
  688.  
  689.      These are excellent books for the beginning Mac programmer.  Both books
  690.      use Think C in their examples, but developers using other platforms
  691.      will find a plethora of useful tidbits.  I believe both books are
  692.      available in Pascal as well.
  693.  
  694.  
  695. Macintosh Revealed, Volume One: Unlocking the Toolbox
  696.    Hayden Books.  ISBN 0-8104-6551-5.  $26.95.
  697. Macintosh Revealed, Volume Two: Programming with the Toolbox
  698.    Hayden Books.  ISBN 0-8104-6561-2.  $26.95.
  699. Macintosh Revealed, Volume Three: Mastering the Toolbox
  700.    Hayden Books.  ISBN 0-672-48402-1.  $26.95.
  701. Macintosh Revealed, Volume Four: Expanding the Toolbox
  702.    Hayden Books.  ISBN 0-672-48413-7.  $26.95.
  703.  
  704.      This encyclopedic collection covers the entire Mac Toolbox for the
  705.      beginning Pascal or Assembly programmer.  It sometimes re-iterates
  706.      Inside Mac, but always offers a fresh perspective.  Volume I covers
  707.      basics including memory management and QuickDraw.  Volume II covers the
  708.      other essential Toolbox managers and exemplifies each by constructing
  709.      part of a complete text editor.  Volume III expands this application,
  710.      covering printing, drivers, desk accessories, sound and definition
  711.      functions.  Volume IV contains details of programming with MultiFinder,
  712.      Color QuickDraw and styled text.
  713.  
  714.  
  715. How to Write Macintosh Software (Third Edition)
  716.    Hayden Books.  ISBN 0-201-?????-?.  ~$30.
  717.  
  718.      This book gives comprehensive coverage of memory management and
  719.      debugging techniques.  It also gives an excellent overview of assembly
  720.      language programming on the Mac.  A must-have.  Somebody please send me
  721.      the ISBN and price of the third edition (I haven't bought mine yet).
  722.  
  723.  
  724. Macintosh Programming Secrets (Second Edition)
  725.    Addison-Wesley.  ISBN 0-201-58134-5.  $29.95.
  726.  
  727.      This is the second edition of Scott Knaster's classic book.  This
  728.      edition was co-authored by Keith Rollin.  From the back cover: "If
  729.      you've ever written Macintosh programs, or want to learn how it's done,
  730.      this book will show you how to perform tasks that aren't explicitly
  731.      documented in the reference books."  This is true.  Get this book if
  732.      you want to learn how to write a tail patch, or how to hide the menu
  733.      bar.  If you don't know what a tail patch is, that's OK; this book
  734.      starts at (or near) the beginning.  A must-have for all beginning- and
  735.      intermediate-level Macintosh programmers.
  736.  
  737.  
  738. On Macintosh Programming: Advanced Techniques
  739.    Addison-Wesley.  ISBN 0-201-51737-X.  $24.95.
  740.  
  741.      This book contains a lot of information on all aspects of programming
  742.      the Mac, including hardware and software architecture, the toolbox,
  743.      and the use of assembly, C, and Pascal for programming the toolbox.
  744.      It includes quite a lot of source code.
  745.  
  746.  
  747. Using the Macintosh Toolbox With C
  748.    Sybex.  ISBN 0-89588-572-7.  $29.95.
  749.  
  750.      This is a fairly good book for beginning Mac programmers.  Experienced
  751.      programmers will find nothing new here.
  752.  
  753.  
  754. Programmer's Guide to MPW, Volume I
  755.    Addison-Wesley.  ISBN 0-201-57011-4.  $26.95.
  756.  
  757.      This is a basic introduction to using MPW.  I don't recommend it for
  758.      anyone who already uses MPW.
  759.  
  760.  
  761. Programming with MacApp
  762.    Addison-Wesley.  ISBN 0-201-09784-2.  $24.95.
  763. C++ Programming with MacApp
  764.    Addison-Wesley.  ISBN 0-201-57020-3.  $24.95.
  765.  
  766.      These give a basic introduction to programming with MacApp; the first
  767.      with Object Pascal, and the second with C++.
  768.  
  769.  
  770. Programming for System 7.
  771.    Addison-Wesley.  ISBN 0-201-56770-9.  $26.95
  772.  
  773.      This is a guide to creating applications for System 7.  It describes
  774.      the new features and functions of the operating system in detail.
  775.      The sample code is in C and includes a complete System 7 application
  776.      in Chapter 1 which is expanded in succeeding chapters.
  777.  
  778.  
  779. ResEdit Complete
  780.    Addison-Wesley.  ISBN 0-201-55075-X.  $29.95.
  781.  
  782.      Most of this book is not written for programmers, but includes quite
  783.      a bit of useful information nonetheless.  It contains detailed
  784.      discussions of using, customizing and programming ResEdit, including
  785.      the creation of custom templates, pickers and editors. It comes with
  786.      ResEdit 2.1 on disk, with sample source code in MPW C and Pascal.
  787.  
  788.  
  789. Debugging Macintosh Software with MacsBug
  790.    Addison-Wesley.  ISBN 0-201-57049-1.  $34.95.
  791.  
  792.      This looks like a really good and useful book, but I haven't had a
  793.      chance to look at it yet.  MacsBug is included on disk, along with
  794.      several examples and dcmds.
  795.  
  796.  
  797. Programming the M68000
  798.    Benjamin/Cummings.  ISBN 0-8053-5550-2.
  799. 680x0 Programming by Example
  800.    Howard W. Sams & Co.  ISBN 0-672-22544-1.  $17.95.
  801. M68000 Assembly Language: Techniques for Building Programs
  802.    Addison-Wesley.  ISBN 0-201-11659-6.
  803. The Complete Book of Macintosh Assembly Language Programming [sic]
  804.    Scott, Foresman & Co.
  805.    Vol I  ISBN 0-673-18379-3
  806.    Vol II ISBN 0-673-18583-4
  807.  
  808.      These are all assembly books that have been recommended by people on
  809.      the net.  The first two are general; the others are specific to the
  810.      Macintosh.
  811.  
  812.  
  813.  
  814. 3.1.3  Periodicals
  815. ------------------
  816.  
  817.  
  818. d e v e l o p
  819.    Quarterly.  $10 per issue.  $30 per year.
  820.    develop
  821.    Apple Computer, Inc.
  822.    P.O. Box 531
  823.    Mt. Morris, IL  61054
  824.    AppleLink DEV.SUBS
  825.  
  826.      develop is Apple's technical journal for the Macintosh and Apple II
  827.      (the focus is on the Mac).  The articles are well-written and useful,
  828.      and it includes the Developer CD.
  829.  
  830.  
  831. MacTech  (was MacTutor)
  832.    Monthly.  $5 per issue.  $40 per year Third Class; $55 First Class.
  833.     Xplain Corporation
  834.     P.O. Box 250055
  835.     Los Angeles, CA  90025-9555
  836.     Phone: (310) 575-4343
  837.       FAX: (310) 575-0925
  838.     mactutor@applelink.apple.com
  839.  
  840.      The only Macintosh programming journal that I'm aware of.  A good
  841.      source of sample code.
  842.  
  843.  
  844.  
  845.  
  846. 3.2  Mailing Lists
  847. ------------------
  848.  
  849. 3.2.1  Comp.Sys.Mac.Programmer Digest
  850. -------------------------------------
  851.  
  852. The Comp.Sys.Mac.Programmer Digest is a collection of article threads from
  853. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  854. regularly and want an archive of the discussions.
  855.  
  856. Each issue of the digest contains one or more sets of articles (called
  857. threads), with each set corresponding to a 'discussion' of a particular
  858. subject.  The articles are not edited; all articles included in the digest
  859. are in their original posted form (as received by the news server at
  860. cs.uoregon.edu).  Article threads are not added to the digest until the last
  861. article added to the thread is at least one month old (this is to ensure that
  862. the thread is dead before adding it to the digest).  Article threads that
  863. consist of only one message are generally not included in the digest.
  864.  
  865. The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
  866. [128.223.8.8] in the directory /pub/mac/csmp-digest.  The most recent issues
  867. are available from sumex-aim.stanford.edu [36.44.0.6] in the directory
  868. /info-mac/digest/csmp.  If you don't have ftp capability, the sumex archive
  869. has a mail server; send a message with the text '$MACarch help' (no quotes)
  870. to LISTSERV@ricevm1.rice.edu for more information.
  871.  
  872. The digest is also available via email.  Just send a note saying that you
  873. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  874. automatically receive each new issue as it is created.  Sorry, back issues
  875. are not available through the mailing list.
  876.  
  877.  
  878.  
  879.  
  880. 3.2.2  Think Class Library Discussion
  881. -------------------------------------
  882.  
  883. The Think Class Library discussion list is for those interested in using
  884. Symantec's Think C and Think Pascal object-oriented class library for
  885. Macintosh.  Discussion topics include
  886.  
  887.    * class usage, design, and implementation
  888.    * TCL bug reports, work-arounds, and fixes
  889.    * TCL application development techniques
  890.    * TCL development aids
  891.  
  892. Mail to the discussion list should be sent to tcl-talk@brown.edu.
  893. If you want to join the discussion list, mail a note saying so to
  894. tcl-request@brown.edu.
  895.  
  896.  
  897.  
  898.  
  899. 3.2.3  MacPsych
  900. ---------------
  901.  
  902. This is a mailing list of psychologists and others interested in using the
  903. Macintosh in research and teaching.  The intention of this service is to
  904. provide quick and authoritative answers to questions raised by Mac-using
  905. researchers and teachers in psychology.  Individuals who have Mac questions
  906. to pose, or have general messages that they believe would be of interest to
  907. research psychologists and teachers using the Macintosh, may send their
  908. information to macpsych@stolaf.edu.  Mail sent to this address will first
  909. pass through the moderator for the list (huff@stolaf.edu) who will forward
  910. it to everyone on the list.
  911.  
  912. If you want to be on the mailing list, mail a note saying so to
  913. macpsych-request@stolaf.edu.
  914.  
  915. There is an archive containing some free Macintosh software that has been
  916. written by members of the group; for more information, write to
  917. macpsych-request@stolaf.edu.
  918.  
  919.  
  920.  
  921.  
  922. 3.3  Miscellaneous
  923. ------------------
  924.  
  925. 3.3.1  Usenet Mac Programmer's Guide
  926. ------------------------------------
  927.  
  928. The Usenet Mac Programmer's Guide (UMPG) is a collection of useful tips
  929. culled  from comp.sys.mac.programmer.  Compiled by Matthew X. Mora
  930. (mxmora@unix.sri.com), it is organized by topic and includes a table of
  931. contents and index.  It is available via anonymous ftp from sumex-aim.
  932. stanford.edu (36.44.0.6) in the directory /info-mac/tech/.
  933.  
  934. It is also available in a pre-printed version, or on disk.
  935.  
  936. To get a copy of the printed version send $17.00 to:
  937.  
  938.      USENET Macintosh Programmer's Guide Printed Version
  939.      39075 Carmel Ct.
  940.      Fremont, CA  94538
  941.  
  942. To get a copy of the disk version send $5.00 to:
  943.  
  944.       USENET Macintosh Programmer's Guide Disk Version
  945.       39075 Carmel Ct.
  946.       Fremont, CA  94538
  947.  
  948.  
  949.  
  950.  
  951. 3.3.2  Kent Sandvik's Frequently Asked MPW C++ and MacApp Questions
  952. -------------------------------------------------------------------
  953.  
  954. This file is available upon request from ksand@apple.com or via anonymous ftp
  955. to ftp.cs.uoregon.edu [128.223.8.8] in the directory /pub/mac.
  956.  
  957.  
  958.  
  959.  
  960. 3.3.3  Comp.Sys.Mac.FAQ
  961. -----------------------
  962.  
  963. This Frequently Asked Questions list provides short answers to a number of
  964. frequently asked questions from the newsgroups comp.sys.mac.system,
  965. comp.sys.mac.misc, and comp.sys.mac.apps.  Some of the questions that it
  966. answers are asked occasionally on comp.sys.mac.programmer.  Please read
  967. this FAQ list before posting to c.s.m.p.  It is available from the sumex
  968. archives and its mirror sites (see section 4.2) in the file /info-mac/
  969. report/csmf-faq.txt.
  970.  
  971.  
  972.  
  973.  
  974.  
  975.                         =============================
  976.                           Section IV: Archive Sites
  977.                         =============================
  978.  
  979.  
  980. 4.1  ftp.apple.com [130.43.2.3]
  981. -------------------------------
  982.  
  983. Contents
  984.    This archive contains just about everything available for free from
  985.    Apple.  Look here first for sample source code, the latest tech
  986.    notes, and tools such as ResEdit and MacsBug.  Very little of what
  987.    can be found here is available from other archives.
  988.  
  989. Access
  990.    Anonymous ftp, from inside the United States only.
  991.    You should read the file /dts/README.FIRST before downloading from this
  992.    archive.  Everything for the Mac is in /dts/mac.  The moderators ask that
  993.    you download during the off-peak hours if at all possible, since this is
  994.    just a IIci running A/UX.
  995.  
  996. Submissions
  997.    You cannot post to this archive.
  998.  
  999.  
  1000. 4.2  sumex-aim.stanford.edu [36.44.0.6]
  1001. ---------------------------------------
  1002.  
  1003. Contents
  1004.    This archive contains a large collection of public-domain and shareware
  1005.    for the Mac.  It is well-maintained and updated regularly.  New
  1006.    submissions to the archive are listed every other day or so in the
  1007.    newsgroup comp.sys.mac.digest.
  1008.  
  1009. Access
  1010.    Anonymous ftp.  Read the files in /info-mac/help for more detailed
  1011.    information about the files in the archive.  Everything is in /info-mac.
  1012.    If you don't have ftp access you can use the mail server; send a message
  1013.    with the text '$MACarch help' (no quotes) to LISTSERV@ricevm1.rice.edu
  1014.    for more information.
  1015.  
  1016. Submissions
  1017.    Sumex accepts all submissions that "are of general benefit to the
  1018.    Macintosh community."  Basically, if you have something that you think is
  1019.    useful, and that other people may like to have, you should feel free to
  1020.    send it to sumex.  All submissions should be compressed and BinHexed, and
  1021.    should include a short but informative blurb at the beginning of the file.
  1022.    Mail your submissions to info-mac@sumex-aim.stanford.edu.  For more
  1023.    detailed information, consult the file
  1024.        /info-mac/help/posting-guidelines.txt.
  1025.  
  1026.  
  1027. 4.3  rascal.ics.utexas.edu [128.83.138.20]
  1028. ------------------------------------------
  1029.  
  1030. This archive is being discontinued as of 5/92.  It will continue to have
  1031. stuff available for a while, perhaps a few months, but the contents will
  1032. eventually dwindle until there is very little or nothing left.
  1033.  
  1034. Contents
  1035.    This archive contains most of what can be found at sumex.  Its
  1036.    emphasis is on utilities and programming-related items, but it
  1037.    contains quite a bit of other stuff as well.  It is the home of
  1038.    the comp.sys.mac.announce archives.  Many items tend to appear
  1039.    here before they show up at sumex or comp.binaries.mac.
  1040.  
  1041. Access
  1042.    Anonymous ftp.
  1043.  
  1044. Submissions
  1045.    No longer accepted.
  1046.  
  1047.  
  1048. 4.4  mac.archive.umich.edu [141.211.164.153]
  1049. --------------------------------------------
  1050.  
  1051. Contents
  1052.    I haven't explored this archive yet, but I hear it has quite a bit
  1053.    of general Macintosh freeware and shareware.
  1054.  
  1055. Access
  1056.    Anonymous ftp.
  1057.  
  1058. Submissions
  1059.    You can submit to this archive by mailing a compressed, binhexed
  1060.    file with a brief descriptive header to macgifts@mac.archive.umich.
  1061.    edu.  This address will also forward your mail to comp.binaries.mac
  1062.    and sumex-aim.stanford.edu.
  1063.  
  1064.  
  1065. 4.5  ftp.cs.uoregon.edu [128.223.8.8]
  1066. -------------------------------------
  1067.  
  1068. Contents
  1069.    This is the home of this FAQ list, as well as the Comp.Sys.Mac.
  1070.    Programmer Digests.  There's also a little sample code not included
  1071.    in the FAQ.
  1072.  
  1073. Access
  1074.    Anonymous ftp.  Directory /pub/mac.
  1075.  
  1076. Submissions
  1077.    Not accepted.
  1078.  
  1079.  
  1080. 4.6  ics.uci.edu [128.195.1.1]
  1081. ------------------------------
  1082.  
  1083. Contents
  1084.    This archive has some Mac stuff, although not nearly as much as the
  1085.    major sites, such as sumex.  The main attraction is the Think C
  1086.    directory.  It contains the latest updates to Think C, as well as
  1087.    Think C related system extensions, fkeys, etc., and source code.
  1088.    Definitely worth checking out if you use Think C extensively.
  1089.  
  1090. Access
  1091.    Anonymous ftp.  Directory /mac.
  1092.  
  1093. Submissions
  1094.    Not accepted, I think.  Someone please correct me if I'm wrong.
  1095.  
  1096.  
  1097. 4.7  ftp.brown.edu [128.148.176.55]
  1098. -----------------------------------
  1099.  
  1100. Contents
  1101.    This is the home of the Think Class Library mailing list.  It includes
  1102.    TCL bug fixes and new classes, as well as an archive of the tcl-talk
  1103.    mailing list.
  1104.  
  1105. Access
  1106.    Anonymous ftp.  Directory /pub/tcl.
  1107.  
  1108. Submissions
  1109.    Submissions to the archive should be mailed to tcl-request@brown.edu or
  1110.    placed in the directory /incoming/tcl with accompanying mail to
  1111.    tcl-request.  Encode all submissions in BinHex 4.0 format and include a
  1112.    descriptive header.  Please do not redistribute Symantec's TCL source.
  1113.  
  1114.  
  1115. 4.8  comp.binaries.mac [newsgroup]
  1116. ----------------------------------
  1117.  
  1118. Contents
  1119.    This is a moderated newsgroup for distribution of Macintosh freeware
  1120.    and shareware.  Just about everything that gets sent to sumex and
  1121.    the other major archives gets sent here as well.
  1122.  
  1123. Access
  1124.    Subscribe to the newsgroup....
  1125.  
  1126. Submissions
  1127.    All files should be compressed and binhexed for mailing.  Posting
  1128.    to the newsgroup should automatically get your file mailed to the
  1129.    moderator.  If this does not happen on your system, you can mail
  1130.    your posting to the moderator yourself at macintosh@dhw68k.cts.com,
  1131.    or at dhw68k!bytebug@ics.uci.edu if the first address doesn't work.
  1132.    Expect a delay of as much as a month before your posting shows up
  1133.    on the newsgroup.
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.                           =========================
  1140.                             Section V: One-liners
  1141.                           =========================
  1142.  
  1143.  
  1144. 5.1  The Main Loop and Events
  1145. -----------------------------
  1146.  
  1147. Call MaxApplZone and MoreMasters when the application starts up.
  1148. If you call SetApplLimit, do it before calling MaxApplZone.
  1149. Use HD in MacsBug while running to estimate how many times to call
  1150. MoreMasters.
  1151. Don't use SetEventMask to disable mouseUp events.  Better not to use it at
  1152. all.
  1153. Call WaitNextEvent if you're running under System 6 or later.
  1154. DTS sample code passes 0x7fffffff to WaitNextEvent when nothing is happening.
  1155. DTS sample code passes GetCaretTime() to WaitNextEvent when flashing a
  1156. cursor.
  1157. Call both GetNextEvent and SystemTask only if WaitNextEvent is unavailable.
  1158. Call IsDialogEvents and DialogSelect even if GetNextEvent returns false.
  1159. SetPort to a known good grafPort once every time through the event loop.
  1160. Set the cursor on suspend and resume events.
  1161. Call GetDblTime to get the maximum time for a double click.
  1162. Measure double click time from mouse up to mouse down.
  1163.  
  1164.  
  1165. 5.2  Menus
  1166. ----------
  1167.  
  1168. Use SetItem to include meta characters literally in menus.
  1169. Prepend an ASCII 0 to a menu item to use a leading '-'.
  1170. Never make MENU resources purgeable.
  1171.  
  1172.  
  1173. 5.3  Resources
  1174. --------------
  1175.  
  1176. GetResource never produces resNotFound.  Check for a NIL handle instead.
  1177. To create a resource file, call HCreate, then HCreateResFile.
  1178. To open a resource file read-only for shared access, use HOpenResFile.
  1179. Don't leave ResLoad set to false.
  1180. GetResource on a dctb may return a non-resource copy of the dctb.
  1181.  
  1182.  
  1183. 5.4  Windows, Alerts, and Dialogs
  1184. ---------------------------------
  1185.  
  1186. Move and size windows to the bounding box of GetGrayRgn.
  1187. Hide scroll bars when deactivating a window.
  1188. Call DrawGrowIcon when activating or deactivating a window with a grow
  1189. region.
  1190. DrawGrowIcon does not check to see if the window has a grow region.
  1191. Call PenNormal before calling DrawGrowIcon.
  1192. itemHit will not be set when a dialog filter is called.
  1193. Use a disabled UserItem to draw the roundrect outline around the OK button.
  1194. ModalDialog assumes the dialog is already visible and in the front.
  1195. Use screenBits.bounds to center dialogs, alerts, etc. below the menu bar.
  1196. If you save window locations in files, they may not be valid for all
  1197. monitors.
  1198. DragWindow expects startPt in boundsRect; if not it may not call
  1199. SelectWindow.
  1200. SelectWindow does not automatically call SetPort.  You must do that yourself.
  1201. DialogSelect responds to activate events but ignores suspend/resume events.
  1202.  
  1203.  
  1204. 5.5  Drawing
  1205. ------------
  1206.  
  1207. Always set the VisRgn and ClipRgn of offscreen ports.
  1208. Set the ClipRgn first when making a picture.
  1209. Don't make rowBytes in bitMaps greater than 8191.
  1210. To dim text, draw a rectangle with penPat=gray and penMode=patbic over it.
  1211. To draw rotated text, draw to an offscreen bitmap, rotate it, and CopyBits
  1212. it.
  1213. Don't use picSize to determine the size of a picture.  Check the handle size.
  1214. Never draw outside a window except in XOR mode for temporary effects like
  1215. drag.
  1216. To avoid animation flicker, synchronize drawing to the vertical retrace.
  1217. CopyBits on more than 3Kb data will work, but it might have to allocate
  1218. memory.
  1219. The small Mac screen is 512 pixels wide by 342 pixels high including menu
  1220. bar.
  1221.  
  1222.  
  1223. 5.6  Files
  1224. ----------
  1225.  
  1226. Don't write in the application file.  This will fail with read-only devices.
  1227. Use PBGetVInfo to convert a VRefNum to a volume name.
  1228. Delete uses the Poor Man's Search Path, so don't delete blindly.
  1229. File Manager routines with dirID=0 use the Poor Man's Search Path.
  1230. Truncate and reallocate files before overwriting to reduce fragmentation.
  1231. Check/change the creator and type of Save As... files before overwriting.
  1232. If you rewrite files by deleting and creating, copy all Finder information.
  1233. Directory ID's are longs, not shorts.  Shorts work ALMOST all the time.
  1234. Always set the version number that appears in some file manager calls to 0.
  1235. To convert a pathRefNum to a name or file number, use PBGetFCBInfo.
  1236. Prevent the creation of files with names that begin with a period.
  1237.  
  1238.  
  1239. 5.7  Interrupts and VBL Tasks
  1240. -----------------------------
  1241.  
  1242. Don't call any Memory Manager routines during an interrupt.
  1243. Unlocked handles may not be valid during an interrupt.
  1244. To synchronize to the vertical retrace on Macs with slots use SlotVInstall.
  1245.  
  1246.  
  1247. 5.8  Handles and Pointers
  1248. -------------------------
  1249.  
  1250. Lock handles before passing their dereferenced pointers to any routine.
  1251. Lock handles before setting referenced data to expressions containing
  1252. functions
  1253. Put an odd long at location zero on a 68000 to help find NIL handle
  1254. references.
  1255. Use HGetState/HLock/HSetState to lock a handle then put it back as it was.
  1256.  
  1257.  
  1258. 5.9  General
  1259.  
  1260. Always use unsigned characters within text and Pascal-format strings.
  1261. Save application preferences in a folder named Preferences in the System
  1262. Folder
  1263. Use SysEnvirons to find the System (Blessed) Folder.
  1264. Use GetAppParms to get the name of the application.
  1265. The high bit of SysParam . volClik enables the alarm clock.
  1266. Check the application name at $910 before exiting with ES within MacsBug.
  1267. To exit to shell in the mini-debugger, enter SM 0 A9 F4 and then G 0.
  1268. In Pascal, don't nest procedures to be passed by procedure pointer.
  1269. In Pascal, "with theHandle^^" is unsafe if memory compaction can occur.
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.                  ===========================================
  1276.                    Section VI: Specific Questions Answered
  1277.                  ===========================================
  1278.  
  1279.  
  1280.  
  1281. 6.1  The Main Loop and Events
  1282. -----------------------------
  1283.  
  1284.  
  1285. ----------------------------------------------------------
  1286. 6.1.1  How do you tell if a specific key is being pressed?
  1287. ----------------------------------------------------------
  1288.  
  1289. Use GetKeys.  GetKeys fills a 16-byte KeyMap structure with the state of
  1290. every key.  Each bit represents a single key on the keyboard; 1 means the
  1291. key is down, 0 means it is up.  Note that there can be a maximum of seven
  1292. keys being pressed at a time - any of the modifier keys plus at most two
  1293. other keys.
  1294.  
  1295. Here's an example in C:
  1296.  
  1297. Boolean IsKeyDown(
  1298.     unsigned short theKey )  // a keyboard-specific scan code for a key
  1299. {
  1300.  
  1301.     unsigned char  keyMap[16];
  1302.  
  1303.     GetKeys( (void *) keyMap );
  1304.     return ((keyMap[theKey>>3] >> (theKey & 7)) & 1);
  1305.  
  1306. }
  1307.  
  1308.  
  1309.  
  1310. -----------------------------------------------------------------------------
  1311. 6.1.2  I'm writing a psychology experiment.  How can I get millisecond timing
  1312.        from the keyboard (or mouse)?
  1313. -----------------------------------------------------------------------------
  1314.  
  1315. The simple answer is that you can't.  Although the new time manager can call
  1316. routines every couple of microseconds, input goes through the event manager,
  1317. which only posts events about every 16 milliseconds.  Thus, even if you poll
  1318. the keyboard every 30 microseconds, you will not get better than 16 ms.
  1319. resolution.  If you really need millisecond accuracy, you need to use
  1320. external hardware.
  1321.  
  1322. The good news is that you probably don't need better than 16 ms. resolution
  1323. anyway.  Measuring with 16 ms. accuracy only increases the standard deviation
  1324. of your RT means by about 4.8 msec.  Read: Ulrich, R. and Giray, M. (1989).
  1325. Time resolution of clocks: Effects on reaction time measurement -- Good news
  1326. for bad clocks.  British Journal of Mathematical and Statistical Psychology,
  1327. 42, 1-12.
  1328.  
  1329. By the way, there is a mailing list dedicated to running psychology
  1330. experiments on the Mac.  It frequently gets tied up in arguments about
  1331. millisecond timing.  The address to write to is macpsych-request@stolaf.edu.
  1332.  
  1333.  
  1334.  
  1335.  
  1336. 6.2  Menus
  1337. ----------
  1338.  
  1339.  
  1340. -------------------------------------------------------------
  1341. 6.2.1  When do you put an ellipsis on the end of a menu item?
  1342. -------------------------------------------------------------
  1343.  
  1344. Put an ellipsis (...) at the end of any menu item which requires more
  1345. information in order to complete or simply displays information.  Usually
  1346. this involves a dialog of some kind, be it modal or non modal.
  1347.  
  1348.  
  1349.  
  1350. -----------------------------------------------------------
  1351. 6.2.2  How do I get the menubar to disappear and re-appear?
  1352. -----------------------------------------------------------
  1353.  
  1354. A set of routines to do this in Pascal can be found in the Usenet
  1355. Macintosh Programmer's Guide.  You can also ftp some sample code in C
  1356. from skinner.cs.uoregon.edu in /pub/mac/menu-bar.c.
  1357.  
  1358.  
  1359.  
  1360. -----------------------------------------------------------------------------
  1361. 6.2.3  What's the difference between the resource ID of a 'MENU' resource and
  1362.        the menuID field of that resource?
  1363. -----------------------------------------------------------------------------
  1364.  
  1365. The resource ID of a 'MENU' resource is just the resource ID - it has no
  1366. hidden meaning.  What is normally expected by beginning programmers is that
  1367. the number that MenuSelect and MenuKey return is the resource ID of the menu.
  1368. In fact, the number returned is the value of the menuID field of the menu,
  1369. and has no relation to the resource ID of the menu.  You can set the menuID
  1370. to any number you want, but by convention it is expected to be the same as
  1371. the resource ID of the menu.  (You can change this value in ResEdit by
  1372. opening the menu you wish to change, and selecting 'Edit Menu & MDEF ID...'
  1373. from the MENU menu.)
  1374.  
  1375.  
  1376.  
  1377.  
  1378. 6.3  Windows, Alerts, and Dialogs
  1379. ---------------------------------
  1380.  
  1381.  
  1382. ---------------------------------------------------------------------
  1383. 6.3.1  How do you put a border around the default button in a dialog?
  1384. ---------------------------------------------------------------------
  1385.  
  1386. The most common way to do this is to create a dummy user item in the dialog,
  1387. and use SetDItem to install a procedure that outlines the default button.
  1388. The dialog's "Initially visible" bit should be false and you should call
  1389. ShowWindow before calling ModalDialog; otherwise, if the button is very tall,
  1390. part of the outline won't be drawn.  Here is an example in C:
  1391.  
  1392.  
  1393. /* This function draws a border around dialog item #1 */
  1394.  
  1395. pascal void OutlineDefault(
  1396.     DialogPtr theDialog,
  1397.     short     theItem )
  1398. {
  1399.  
  1400.     Rect     itemRect;
  1401.     Handle   itemHandle;
  1402.     short    itemType;
  1403.     short    diameter;
  1404.  
  1405.     GetDItem( theDialog, 1, &itemType, &itemHandle, &itemRect );
  1406.     diameter = (itemRect.bottom - itemRect.top) / 2 + 6;
  1407.     if ( diameter < 16 )
  1408.         diameter = 16;
  1409.     PenSize( 3, 3 );
  1410.     InsetRect( &itemRect, -4, -4 );
  1411.     FrameRoundRect( &itemRect, diameter, diameter );
  1412.  
  1413. }
  1414.  
  1415.  
  1416.  
  1417. /* Assume myDialog has been initialized, and item #4 is the dummy
  1418.    user item for outlining the default button.  The following lines
  1419.    install the outlining procedure OutlineDefault into the user
  1420.    item, so that OutlineDefault will be called by the Dialog Manager
  1421.    each time the dialog needs to be redrawn.  Depending on your
  1422.    compiler, you may have to cast OutlineDefault to a Handle. */
  1423.  
  1424. GetDItem( myDialog, 4, &itemType, &itemHandle, &itemRect );
  1425. SetDItem( myDialog, 4, itemType, OutlineDefault, &itemRect );
  1426.  
  1427.  
  1428.  
  1429.  
  1430. 6.4  Drawing
  1431. ------------
  1432.  
  1433.  
  1434. ----------------------------------------------------------------
  1435. 6.4.1  What is the fastest way to paint one pixel on the screen?
  1436. ----------------------------------------------------------------
  1437.  
  1438. Using QuickDraw, the fastest way to draw one pixel is
  1439.    MoveTo( x, y );
  1440.    Line( 0, 0 );
  1441. making sure that the pen size is 1 by 1.  This is about twice as fast as
  1442. setting the pen size to 0 by 1 or 1 by 0 and calling Line( 1, 0 ) or
  1443. Line( 0, 1 ), respectively.  I'm not sure why....
  1444.  
  1445. See below for how to draw a pixel without using QuickDraw.
  1446.  
  1447.  
  1448.  
  1449. ----------------------------------------------------------------------
  1450. 6.4.2  How do you draw directly into a pixmap without using QuickDraw?
  1451. ----------------------------------------------------------------------
  1452.  
  1453. As an example, here is a routine that paints a single pixel in a pixmap.
  1454. To use this procedure, you just have to know what 'value' to pass in.  This
  1455. depends on the current bit-depth of 'thePixMap.'  The rightmost n bits of
  1456. 'value' are used for the pixel value for depth = n.  For depths of eight or
  1457. less, the value of each pixel is an index into a color table.  For depth =
  1458. 16,
  1459. each 16-bit pixel is interpreted as an RGB value, as follows:
  1460.  
  1461.          Bit: 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
  1462.        Value:  R  R  R  R  R  G  G  G  G  G  B  B  B  B  B  U
  1463.  
  1464. where R = Red, G = Green, B = Blue, and U = Unused.  For depth = 32, each
  1465. 32-bit pixel is interpreted as an RGB value as follows:
  1466.  
  1467.          Bit: 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
  1468.        Value:  A  A  A  A  A  A  A  A  R  R  R  R  R  R  R  R
  1469.  
  1470.          Bit: 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
  1471.        Value:  G  G  G  G  G  G  G  G  B  B  B  B  B  B  B  B
  1472.  
  1473. where R = Red, G = Green, B = Blue, and A = Alpha.
  1474.  
  1475.  
  1476.  
  1477. void SetPixel(
  1478.     short           x,
  1479.     short           y,
  1480.     long            value,
  1481.     PixMapHandle    thePixMap )
  1482. {
  1483.  
  1484.     unsigned long   rowBytes;
  1485.     unsigned char   mask;
  1486.     unsigned char   shiftBits;
  1487.     unsigned char   *thePixel;
  1488.     unsigned char   pixelDepth;
  1489.     char            mode = true32b;
  1490.     Boolean         swapMode;
  1491.         swapMode = PixMap32Bit( thePixMap );
  1492.  
  1493.     LockPixels( thePixMap );
  1494.  
  1495.     rowBytes = (unsigned long) ((*thePixMap)->rowBytes & 0x1fff);
  1496.     thePixel = (unsigned char *) GetPixBaseAddr( thePixMap );
  1497.  
  1498.     pixelDepth = (*thePixMap)->pixelSize;
  1499.  
  1500.     switch ( pixelDepth ) {
  1501.             case 1:
  1502.         case 2:
  1503.         case 4:
  1504.         case 8:
  1505.  
  1506.             thePixel += (rowBytes * y) +
  1507.                         (((unsigned long) pixelDepth * x) / 8L);
  1508.  
  1509.             shiftBits = ((8 - pixelDepth) - ((x * pixelDepth) % 8));
  1510.  
  1511.             mask = (unsigned char) ((1 << pixelDepth) - 1) << shiftBits;
  1512.  
  1513.             if ( swapMode ) {
  1514.                 SwapMMUMode( &mode );
  1515.             }
  1516.  
  1517.             *thePixel &= ~mask;
  1518.             *thePixel |= (unsigned char) value << shiftBits;
  1519.  
  1520.             break;
  1521.  
  1522.  
  1523.         case 16:
  1524.  
  1525.             thePixel += (rowBytes * y) + (2L * x);
  1526.  
  1527.             if ( swapMode ) {
  1528.                 SwapMMUMode( &mode );
  1529.             }
  1530.  
  1531.             *((unsigned short *)thePixel) = (unsigned short) value;
  1532.  
  1533.             break;
  1534.  
  1535.  
  1536.         case 32:
  1537.  
  1538.             thePixel += (rowBytes * y) + (4L * x);
  1539.  
  1540.             if ( swapMode ) {
  1541.                 SwapMMUMode( &mode );
  1542.             }
  1543.  
  1544.             *((unsigned long *)thePixel) = value;
  1545.  
  1546.             break;
  1547.  
  1548.  
  1549.         default:
  1550.             break;
  1551.  
  1552.     }
  1553.  
  1554.     if ( swapMode ) {
  1555.         SwapMMUMode( &mode );
  1556.     }
  1557.  
  1558.     UnlockPixels( thePixMap );
  1559.  
  1560. }
  1561.  
  1562.  
  1563.  
  1564. ------------------------------------------------------------------------
  1565. 6.4.3  How do you draw directly onto the screen without using QuickDraw?
  1566. ------------------------------------------------------------------------
  1567.  
  1568. Get the pixmap for the monitor that you want to draw on, and send it to the
  1569. above procedure.  For example, to draw a red dot at position 10,10 on the
  1570. main screen (if the main screen is in 32-bit mode):
  1571.  
  1572.    GDHandle   theDevice;
  1573.  
  1574.    theDevice = GetMainDevice();
  1575.  
  1576.    SetPixel( x, y, 0x00FF0000, (*theDevice)->gdPMap );
  1577.  
  1578. If you are drawing directly to the screen, you should always wrap your
  1579. drawing with calls to ShieldCursor and ShowCursor.  Some monitors such
  1580. as the Radius Pivot series keep a virtual screen, and they don't update
  1581. the real screen unless they have to.  When you write directly to the
  1582. screen, you're actually writing to the virtual screen, and your drawing
  1583. won't show up on the real screen until the system has some other reason
  1584. to update the monitor.  Calling ShieldCursor each time you draw will
  1585. force these systems to update the real screen when you expect them to.
  1586.  
  1587.  
  1588.  
  1589. -----------------------------------------------------------------------
  1590. 6.4.4  What RGB value does the system use for dimmed buttons, menus and
  1591.        window titles?
  1592. -----------------------------------------------------------------------
  1593.  
  1594. The gray color does not have a fixed RGB value.  It is a weighted average of
  1595. the foreground and background colors.  To obtain the appropriate 'gray' color
  1596. for a given foreground and background color, use the Palette Manager routine
  1597. GetGray (documented in Inside Macintosh Volume VI).
  1598.  
  1599. pascal Boolean GetGray( GDHandle device, const RGBColor *backGround,
  1600.                         RGBColor *foreGround )
  1601.   = {0x303C,0x1219,0xAAA2};
  1602.  
  1603. If at least one gray or intermediate color is available, GetGray stores the
  1604. color in foreGround and returns true.  If no gray is available, or, if you
  1605. supplied two colors, no third distinguishable color is available, the
  1606. foreGround parameter is unchanged and the function returns false.
  1607.  
  1608. GetGray is not available in older versions of the system.  Use Gestalt to
  1609. determine whether it is available.
  1610.  
  1611.  
  1612.  
  1613.  
  1614. 6.5  Files
  1615. ----------
  1616.  
  1617.  
  1618. ----------------------------------------------
  1619. 6.5.1  Why is the File Manager so hard to use?
  1620. ----------------------------------------------
  1621.  
  1622. Its always those pesky wdrn's that are the problem.  Here is a summary of
  1623. some of the things to know:
  1624.  
  1625.     vrn = volume reference number
  1626.           (small negative number; e.g. -2)
  1627.     wdrn = working directory reference number
  1628.            (large negative number; e.g. -32123)
  1629.     dirID = directory ID
  1630.             (small (but long integer!) positive number; e.g. 4123)
  1631.  
  1632.     - vrn's and wdrn's can be used interchangably for the most part.
  1633.     - A vrn represents either a volume, or the root directory of a volume.
  1634.     - A wdrn represents a directory on a volume.
  1635.     - A dirID represents nothing without a vrn or a wdrn.
  1636.     - A dirID overrides the directory otherwise specified by the vrn or wdrn
  1637.       unless it's zero, in which case it's ignored.  If it is 2 it specifies
  1638.       the root directory of the volume.
  1639.     - You should always use vrn,dirID pairs. To convert a wdrn into a
  1640.       vrn,dirID pair use GetWDInfo, which returns the vRefNum, the dirID and
  1641.       the procID of the wdRefNum.  The procID is almost always 'ERIK'.
  1642.     - You can also use GetVol/SetVol to convert volume names to/from vrns.
  1643.     - To store a vrn,dirID pair (between invocations of a program) convert
  1644.       the vrn to a volume name & creation date (for verification) and store
  1645.       them and the dirID (and a filename perhaps).
  1646.  
  1647.  
  1648.  
  1649. --------------------------------------
  1650. 6.5.2  How do you get a full pathname?
  1651. --------------------------------------
  1652.  
  1653. Take a look at Tech Note #238, available from APDA (and other places).  It
  1654. tells you everything you need to know to get a full pathname, and why you
  1655. should, in general, use a volume name, dirID, filename (and perhaps volume
  1656. creation date) triple instead.  Also check out the code snippets available
  1657. from ftp.apple.com et al.  There are a couple of snippets that give code to
  1658. get a full pathname, as well as many other cool file manager tricks.
  1659.  
  1660.  
  1661.  
  1662. --------------------------------------------------
  1663. 6.5.3  How do you set the SFGet/PutFile directory?
  1664. --------------------------------------------------
  1665.  
  1666. To set the directory that is displayed by SFGet/PutFile, stuff the volume
  1667. reference number into SFSaveDisk, and the dirID into CurDirStore.
  1668.  
  1669.      CurDirStore = $398;   Current dirID from Standard File (long)
  1670.      SFSaveDisk = $214;    Negative of current vRefNum
  1671.  
  1672.  
  1673.  
  1674. -----------------------------------------------------
  1675. 6.5.3  How do you access the application's data fork?
  1676. -----------------------------------------------------
  1677.  
  1678. Call CurResFile when the application starts up.
  1679. Call PBGetFCBInfo to convert that refNum into a vRefNum, dirID and name.
  1680. Call HOpen with the vRefNum, dirID, and name to open up your data fork.
  1681.  
  1682.  
  1683.  
  1684.  
  1685. 6.6  Handles and Pointers
  1686. -------------------------
  1687.  
  1688.  
  1689. ----------------------------------
  1690. 6.6.1  When should I call MoveHHi?
  1691. ----------------------------------
  1692.  
  1693. MoveHHi is an expensive operation; calling it when you don't need to can
  1694. significantly slow down your program.  Additionally, over-calling of MoveHHi
  1695. can fragment the top of your heap.  Call MoveHHi before locking a handle that
  1696. is followed by some memory allocation.  To efficiently move a handle high in
  1697. the heap and then lock it, you might want to call HLockHi, a call new with
  1698. MPW 3.2 and THINK C 5.0 (probably THINK Pascal 4.0 as well).
  1699.  
  1700.  
  1701.  
  1702. -------------------------------------------------------------------------
  1703. 6.6.2  Why does malloc/calloc keep crashing or returning NULL in Think C?
  1704. -------------------------------------------------------------------------
  1705.  
  1706. #include <stdlib.h>
  1707.  
  1708. Explanation:  In THINK C, parameters and return values are 2-byte ints by
  1709. default, which causes the value passed to malloc to be $10000 times as large
  1710. as you think it is, and causes the upper bytes of the return value to be
  1711. zeroed.  Including stdlib includes a prototype which overrides the defaults.
  1712.  
  1713. Another common cause of problems with malloc is overwriting the end of a
  1714. string, such as only mallocing the size of the string and then writing the
  1715. string plus a null into the malloc'd space.  Think's malloc algorithm stores
  1716. block size information in space adjacent to the storage it allocates, so
  1717. overwriting the storage tends to cause havoc. The problem may not show
  1718. immediately since it will probably be the next malloc that encounters
  1719. problems.
  1720.  
  1721.  
  1722.  
  1723.  
  1724. 6.7  Standalone Code
  1725. --------------------
  1726.  
  1727.  
  1728. ------------------------------
  1729. 6.7.1  How do I write an INIT?
  1730. ------------------------------
  1731.  
  1732. There is a simple INIT (SetWindow INIT) with source code and explanations in
  1733. the Usenet Macintosh Programmer's Guide.  There is also a chapter on writing
  1734. system extensions in Macintosh Programming Secrets (2nd Ed.).  Be sure to
  1735. check out the ftp sites (especially ftp.apple.com) for sample inits.
  1736.  
  1737.  
  1738.  
  1739.  
  1740. 6.8  General
  1741. ------------
  1742.  
  1743.  
  1744. --------------------------------------------------------------
  1745. 6.8.1  How do I register signatures and file types with Apple?
  1746. --------------------------------------------------------------
  1747.  
  1748. Registering a signature and file type is free, and you don't have to be an
  1749. Apple Partner or Associate.  You can ftp the registration form from
  1750. ftp.apple.com; it's available as
  1751.      /dts/mac/registration/creator-file-type-form.txt.
  1752.  
  1753.  
  1754.  
  1755. -------------------------------------------------------------------------
  1756. 6.8.2  How do I go about writing serial port communications?
  1757.  
  1758. These days, it is best to use the new Comunications Toolbox (CTB).  By
  1759. utiizing the CTB, you will be able to write your code to a single
  1760. specification, and the code will work with all current CTB "tools" and all
  1761. future CTB tools. The CTB tools allow programmers to extend the CTB's
  1762. functionality. There is a tool for each facet of the communications puzzle:
  1763. Connection Tools, Terminal Tools, and File Transfer Tools.
  1764.  
  1765. For example, once I have written a piece of code that uses the Serial tool to
  1766. connect me to a terminal server, combined with the VT102 Tool to emulate a
  1767. vt102 terminal, and the XMODEM Macbinary Tool to transfer files, the same
  1768. code will work with Apple Modem Tool, TCP/IP, AppleTalk ADSP, ISDN, X.25, and
  1769. all future Connection Tools. Further, the terminal can emulate a VT320,
  1770. ASCII, or other terminals. Files may be transfered with XMODEM, TEXT, and
  1771. soon ZMODEM and Kermit protocols.
  1772.  
  1773. The disadvantage of the CTB is that you must limit yourself to the
  1774. specification of the Connection, Terminal, and File Transfer interfaces.
  1775. These limitations are *rarely* a problem, but clearly something like a FAX
  1776. interface program or real time data analyzer, would have to seriously
  1777. consider the interfaces before committing.
  1778.  
  1779. For most standard communications applications, such as terminal emulators,
  1780. Bulletin Board Systems, etc., the CTB is the correct choice.
  1781.  
  1782. You can only get the CTB development kit from APDA.  It is affordable,
  1783. somewhere just under $100.  This includes working sample code.
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.                       ================================
  1790.                         Section VII: Eternal Debates
  1791.                       ================================
  1792.  
  1793.  
  1794. These questions have no final answers.  They pop up every few months and
  1795. waste a tremendous amount of valuable network resources on discussions
  1796. that will never be resolved.  Most people would be happy if they were
  1797. never discussed again in this newsgroup.
  1798.  
  1799.  
  1800. 7.1  Why doesn't the Mac do preemptive multitasking?
  1801. ----------------------------------------------------
  1802.  
  1803. Pro-preemptives claim the current scheme is too vulnerable to ill-behaved
  1804. applications and too much trouble for application writers.  Anti-
  1805. preemptives claim that preemptive multitasking would reduce interactive
  1806. response, and that the current cooperative system works well.
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.                        ==============================
  1813.                          Credits / Acknowledgements
  1814.                        ==============================
  1815.  
  1816.  
  1817. Many thanks to Ben Haller, who started this whole thing, and did quite a lot
  1818. of work on this posting before handing it off to Michael A. Kelly.  Many
  1819. thanks to Michael A. Kelly also, for all his work in establishing and
  1820. maintaining this FAQ (in addition to continuing to keep the
  1821. Comp.Sys.Mac.Programmer Digest) before passing the baton.
  1822.  
  1823. Thanks to these people for proofreading this list during its development:
  1824.     Ben Haller
  1825.     Wally Wedel
  1826.     John B. Matthews
  1827.     Patrick Beard
  1828.     Steve Zellers
  1829.  
  1830. Thanks to Chris Webster for the one-liners.
  1831.  
  1832. Thanks to Peter Lewis for the answers to the following specific questions:
  1833.     6.2.1  When do you put an ellipsis on the end of a menu item?
  1834.     6.5.1  Why is the File Manager so hard to use?
  1835.     6.5.2  How do you get a full pathname?
  1836.     6.5.3  How do you set the SFGet/PutFile directory?
  1837.  
  1838. Thanks to Greg Ferrar for the review on TMON Pro.
  1839.  
  1840. Thanks to John Rinaldo for the review on Jasik's Debugger.
  1841.  
  1842. Thanks for Fritz Anderson for his descriptions of SourceBug and the new
  1843. Inside Macintosh volumes.
  1844.  
  1845. And thanks to everyone who has offered suggestions or constructive
  1846. criticism....  Keep those comments coming!
  1847.  
  1848.  
  1849.  
  1850.  
  1851. --
  1852. -------------------------------------------------------------------
  1853.  Daryl_Spitzer@mindlink.bc.ca     "Life isn't just, life just is."
  1854.          a2251@mindlink.bc.ca              -- Me  (I think.)
  1855. -------------------------------------------------------------------
  1856.